package com.demo.principle.liSubstitution;

public class LiSubstitution {
    public static void main(String[] args) {
        C a = new C();
        System.out.println(a.func1(11, 3));

        D b = new D();
        System.out.println(b.func1(11, 3));// B类中重写了func1，导致结果不是9
    }
}

class A {

    public int func1(int num1, int num2) {
        return num1 - num2;
    }
}

class B extends A {

    public int func1(int num1, int num2) {
        return num1 + num2;
    }

    public int func2(int num1, int num2) {
        return func1(num1, num2) + 9;
    }
}
